package com.wk.springboot.config;

import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname MyKeyGenerator
 * @Description 自定义KeyGenerator
 * @Date 2020/7/9 19:35
 * @Author by weikai
 */
@Configuration
public class MyKeyGenerator implements KeyGenerator {

  @Override
  public Object generate(Object target, Method method, Object... params) {
    List paramList = new LinkedList();
    for(Object param : params){
      paramList.add(param);
    }
    return paramList;
  }
}
